package utils;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class MiscUtils {
       
        public static WebElement waitWebPage(WebDriver driver, By by){
                WebDriverWait wait = new WebDriverWait(driver, 10);
                WebElement myDynamicElement = wait.until(ExpectedConditions.presenceOfElementLocated(by));
                return myDynamicElement;
        }
       
        public static void waitWebPage(Integer waitseconds){
                try {
                        Thread.sleep(2000);
                  } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  }
        }
}

